import Vue from "vue";
import VueRouter from "vue-router";

import Demo from "@/views/Demo";
import Editor from "@/views/editor";
import Develop from "@/views/develop";
import HotArea from "@/views/hotArea";
import Preview from "@/views/preview";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
  },
  {
    path: "/list",
    name: "list",
  },
  {
    path: "/develop",
    name: "develop",
    component: Develop,
  },
  {
    path: "/hotarea",
    name: "HotArea",
    component: HotArea,
  },
  {
    path: "/editor",
    name: "editor",
    component: Editor,
  },
  {
    path: "/preview",
    name: "preview",
    component: Preview,
  },
  {
    path: "/demo",
    name: "demo",
    component: Demo,
  },
];

const router = new VueRouter({
  routes,
});

router.beforeEach(async (to, from, next) => {
  console.log("to==", to);
  console.log("from==", from);
  return next();
});

export default router;
